#ifndef __OLED_H
#define __OLED_H

#ifdef __cplusplus
extern "C" {
#endif

#include "main.h"

// OLED参数定义
#define OLED_WIDTH 128
#define OLED_HEIGHT 64
#define OLED_PAGES (OLED_HEIGHT/8)

// OLED颜色模式
typedef enum {
    OLED_COLOR_NORMAL = 0,
    OLED_COLOR_INVERSE = 1
} OLED_ColorMode;

// 字体结构体
typedef struct {
    const uint8_t *data;
    uint8_t width;
    uint8_t height;
} ASCIIFont;

// 函数声明
void OLED_Init(void);
void OLED_Clear(void);
void OLED_DisplayOn(void);
void OLED_DisplayOff(void);
void OLED_SetColorMode(OLED_ColorMode mode);
void OLED_SetPixel(uint8_t x, uint8_t y, OLED_ColorMode color);
void OLED_PrintString(uint8_t x, uint8_t y, char *str, OLED_ColorMode color);
void OLED_PrintNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len, OLED_ColorMode color);
void OLED_ShowFrame(void);

#ifdef __cplusplus
}
#endif

#endif /* __OLED_H */ 
